Motor current controller and method for controlling motor current

ABSTRACT

A motor current controller operates to: set a reference current value and a decay mode switching time for each PWM cycle based on a positional relationship between a rotor and a stator; switch an H-bridge circuit to the charge mode at the time of start of each PWM cycle; switch the H-bridge circuit to the fast decay mode and store a charge mode time when determined that the motor current is greater than the reference current value; switch the H-bridge circuit to the slow decay mode when the decay mode switching time elapses; compare the charge mode time of the corresponding PWM cycle in a present falling side with the charge mode time of the PWM cycle in a previous falling side; update the decay mode switching time of the PWM cycle previous to the corresponding PWM cycle in a subsequent falling side.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a motor current controller and a methodfor controlling motor current which are suitable to be implemented forcontrolling a stepping motor.

2. Description of the Related Art

When an inductive load such as a motor coil is current-driven by anH-bridge circuit, pulse width modulation (PWM) control is often used.The PWM control is to control a current in a load by repeating chargeand discharge of the current.

An example of motor drive using the PWM control is described, forexample, in JP-A-2002-204150. In the abstract of JP-A-2002-204150, it isdescribed that the problem to be solved by the disclosure is: “tosuppress pulsation of load current by performing accurate currentcontrol when constant current control is performed by repeatingcharge/discharge of a current for a reactance load through an H-bridgecircuit mounted on an IC.” It is also described that the solution forthe problem is: “The semiconductor integrated circuit comprises anH-bridge circuit for driving a coil load L being connected with a pairof external output terminals 15 and 16, a PWM control circuit 20 fordriving the switching of output switch elements 11-14 in the H-bridgecircuit with a PWM signal and setting a charge mode, a slow decay modeor a fast decay mode of the H-bridge circuit selectively for the load, afirst current detection circuit 21 for detecting a load current droppingbelow a first set level in fast decay mode for the load, and an outputcontrol logic circuit 23 for controlling a PWM control circuit byreceiving a detection output from the first current detection circuit 21and generating a control signal for making a switch to the slow decaymode.”

As one of the above-mentioned motor driving method, a micro-step drivemethod is known which has small residual vibration and excellentstability when a rotor rotates particularly at a low speed. In thismethod, field effect transistors (FETs) which are switching elements ofthe H-bridge circuit are subjected to the PWM control to match a motorcurrent with a reference current curve (hereinafter, referred to as a“reference current”) having a substantially sinusoidal wave shape whichis induced from the positional relationship between a rotor and astator, thereby realizing constant current control. A basic step angle(for example, one turn) is divided into 1/n and the reference current ischanged every the divided angle periods. These angle periods arereferred to as micro-steps and each have one or more PWM cycles. Thatis, a microcomputer or the like can easily generate a stepwise currentwhich varies in a stepwise manner.

However, during a state where the motor current is falling, a currentwaveform in the charge mode varies depending on a drive voltage, arotation speed, a load torque condition, or the like of a motor. Sinceinductance of the coil varies depending on the positional relationshipbetween the rotor and the stator and it is thus difficult to control themotor current waveform using the current detection circuit, a decayspeed of the motor current during discharge may cause current ripples(current fluctuation) of the motor current. The current ripples causetorque loss, vibration, or noise of the motor. Frequent switching of acoil voltage and current-supply direction between the charge mode andthe fast decay mode may cause electromagnetic noise.

In the technique described in JP-A-2002-204150, two comparators areprovided to compare a measured current value with two reference valuesand the operation mode is switched based on the comparison result and/orthe time. As another technique, it can also be considered that theripples are suppressed by increasing the number of steps divided in themicro-step drive to shorten the PWM cycle. However, as described inJP-A-2002-204150, addition of two comparators causes an increase incost. Since the shortening of the PWM cycle excessively increases theload of the microcomputer, it is necessary to use a dedicated motordriver or a high-cost microcomputer, thereby causing an increase incost.

SUMMARY OF THE INVENTION

One of objects of the present invention is to provide a motor currentcontroller and a method for controlling motor current that can suitablycontrol a motor current to follow a target value with a low-costconfiguration.

According to an illustrative embodiment of the present invention, thereis provided a motor current controller including: an H-bridge circuitthat includes a switching element and is connected to a motor coilprovided in a motor; and a control unit that drives the switchingelement every PWM cycle and designates any operation mode from among aplurality of modes including a charge mode, in which a motor currentflowing in the motor coil increases, a fast decay mode, in which themotor current is decreased, and a slow decay mode, in which the motorcurrent is decreased at a speed lower than that in the fast decay mode,for the H-bridge circuit. The control unit is configured to perform aseries of process including: setting a reference current value and adecay mode switching time for each PWM cycle based on a positionalrelationship between a rotor and a stator; switching the H-bridgecircuit to the charge mode at the time of start of each PWM cycle;determining whether the motor current is greater than the referencecurrent value; switching the H-bridge circuit to the fast decay mode andstoring a charge mode time when determined that the motor current isgreater than the reference current value; switching the H-bridge circuitto the slow decay mode when the decay mode switching time elapses aftera time point at which the H-bridge circuit is switched to the fast decaymode; comparing the charge mode time of the corresponding PWM cycle in apresent falling side with the charge mode time of the PWM cycle havingthe same number as the corresponding PWM cycle in a previous fallingside; and updating, based on a result of the comparing of the chargemodes, the decay mode switching time of the PWM cycle previous to thecorresponding PWM cycle in a subsequent falling side.

According to another illustrative embodiment of the present invention,there is provided a method for controlling motor current of a motorcurrent controller having an H-bridge circuit that includes a switchingelement and is connected to a motor coil provided in a motor and acontrol unit that drives the switching element every PWM cycle anddesignates any operation mode from among a plurality of modes includinga charge mode, in which a motor current flowing in the motor coilincreases, a fast decay mode, in which the motor current is decreased,and a slow decay mode, in which the motor current is decreased at aspeed lower than that in the fast decay mode, for the H-bridge circuit.The method includes: setting a reference current value and a decay modeswitching time for each PWM cycle based on a positional relationshipbetween a rotor and a stator; switching the H-bridge circuit to thecharge mode at the time of start of each PWM cycle; determining whetherthe motor current is greater than the reference current value; switchingthe H-bridge circuit to the fast decay mode and storing a charge modetime when determined that the motor current is greater than thereference current value; switching the H-bridge circuit to the slowdecay mode when the decay mode switching time elapses after a time pointat which the H-bridge circuit is switched to the fast decay mode;comparing the charge mode time of the corresponding PWM cycle in apresent falling side with the charge mode time of the PWM cycle havingthe same number as the corresponding PWM cycle in a previous fallingside; and updating, based on a result of the comparing of the chargemodes, the decay mode switching time of the PWM cycle previous to thecorresponding PWM cycle in a subsequent falling side.

BRIEF DESCRIPTION OF THE DRAWINGS

In the accompanying drawings:

FIG. 1 is a block diagram illustrating an entire configuration of amotor control system according to an embodiment of the presentinvention;

FIG. 2 is a block diagram illustrating a detailed configuration of amotor controller;

FIGS. 3A to 3F are diagrams illustrating operation modes of an H-bridgecircuit;

FIGS. 4A and 4B are waveform diagrams of a reference current value withrespect to a rotation angle of a motor;

FIG. 5 is a diagram illustrating current control data of each PWM cyclein a falling side to be controlled;

FIG. 6 is a diagram illustrating a falling side to be controlled;

FIG. 7 is a diagram illustrating an example of the PWM cycle in afalling side to be controlled;

FIG. 8 is a flowchart illustrating a falling side control routine;

FIG. 9 is a flowchart illustrating the falling side control routine;

FIG. 10 is a flowchart illustrating a decay mode switching time settingroutine;

FIG. 11 is a diagram illustrating synchronization of a motor rotationangle with a PWM cycle every 90 degrees;

FIG. 12 is a diagram illustrating synchronization of the motor rotationangle with a PWM cycle every 180 degrees; and

FIG. 13 is a diagram illustrating synchronization of the motor rotationangle with a PWM cycle every 360 degrees.

DETAILED DESCRIPTION

Hereinafter, an embodiment of the present invention will be described indetail with reference to the accompanying drawings. FIG. 1 is a blockdiagram illustrating an entire configuration of a motor control systemaccording to the embodiment. As shown in FIG. 1, a motor 120 is abipolar two-phase stepping motor and includes a rotor 126 including apermanent magnet and formed to be rotatable and stators formed at foursection positions in the circumferential direction of the rotor 126. Thestators include X-phase stators 122XP and 122XN and Y-phase stators122YP and 122YN. The stator 122XP and the stator 122XN are located onthe opposite sides with the rotor 126 interposed therebetween. Thestator 122YP and the stator 122YN are located on the opposite sides withthe rotor 126 interposed therebetween and are perpendicular to thestator 122XP and the stator 122XN. A winding is wound on each stator inthe same direction. The windings wound on the stators 122XP and 122XNare connected in series and both windings are referred to as a “statorwinding 124X”. Similarly, the windings wound on the stators 122YP and122YN are connected in series and both windings are referred to as a“stator winding 124Y”.

A host device 130 outputs a speed command signal indicating a rotationspeed of the motor 120. A motor controller 100 (an example of a motorcurrent controller) controls driving of the motor 120 in accordance withthe speed command signal. The motor controller 100 is provided withH-bridge circuits 20X and 20Y and applies an X-phase voltage VMX and aY-phase voltage VMY to the stator windings 124X and 124Y, respectively.

FIG. 2 is a block diagram illustrating a detailed configuration of themotor controller 100. In FIG. 1, two sets of stator windings 124X and124Y and two sets of H-bridge circuits 20X and 20Y are illustrated.However, in FIG. 2, these H-bridge circuits are collectively shown asonly one set of stator winding 124 and one set of H-bridge circuit 20for the purpose of simplification.

A central processing unit (CPU) 101, which is installed in the motorcontroller 100, controls other modules via a bus 106 based on a controlprogram stored in a read only memory (ROM) 103. A random access memory(RAM) 102 is used as a work memory of the CPU 101. A timer 104 measuresan elapsed time from a reset timing under the control of the CPU 101. AnI/O port 105 inputs and outputs a signal between the host device 130illustrated in FIG. 1 or an external device. A bridge controller 107controls a bridge control circuit 110 based on a command from the CPU101. A current limit controller 112 controls a PWM signal generator 113so as to limit a current if necessary.

The bridge control circuit 110 is configured as a single integratedcircuit. The PWM signal generator 113 therein generates and supplies aPWM signal to the H-bridge circuit 20 under the control of the bridgecontroller 107. The H-bridge circuit 20 includes switching elements 2,4, 6, 8, 15, and 17 which are, for example, field effect transistors(FETs). The PWM signal is an ON/OFF signal which is applied as a gatevoltage to the switching elements 2, 4, 6, 8, 15, and 17. In thedrawing, a lower terminal of each of the switching elements 2, 4, 6, 8,15, and 17 is a source terminal and an upper terminal thereof is a drainterminal.

The switching elements 2 and 4 are connected in series, and the seriescircuit is connected to a DC power source 140 and a ground line 142 andis supplied with a predetermined voltage Vdd. Similarly, the switchingelements 6 and 8 are connected in series, and the series circuit issupplied with the voltage Vdd. Diodes 12, 14, 16, and 18 are refluxdiodes and are connected in parallel to the switching elements 2, 4, 6,and 8. The switching elements 15 and 17 are formed to detect a currentand constitute current mirror circuits along with the switching elements4 and 8, respectively. Accordingly, currents proportional to thecurrents flowing in the switching elements 4 and 8 flow in the switchingelements 15 and 17, respectively. The switching elements 2, 4, 6, and 8may use their parasitic diodes instead of the reflux diodes. A voltageVMout0 of a connection point between the switching elements 2 and 4 isapplied to one end of the stator winding 124 of the motor 120. A voltageVMout1 of a connection point between the switching elements 6 and 8 isapplied to the other end of the stator winding 124. Accordingly, a motorvoltage VM(=voltage VMout0−VMout1) which is a difference therebetween isapplied to the stator winding 124. The motor voltage VM actuallyincludes an X-phase voltage VMX and a Y-phase voltage VMY illustrated inFIG. 1.

A current detector 116 outputs a measured current value Icoil of thecurrent flowing in the stator winding 124 by measuring the current valueflowing in the switching elements 15 and 17 depending on the currentdirection. A D/A converter 115 receives a digital value of a referencecurrent value Iref from the bridge controller 107 and converts thereceived digital value into an analog value. A comparator 114 comparesthe measured current value Icoil as an analog value with the referencecurrent value Iref, outputs a signal of “1” when the measured currentvalue is equal to or greater than the reference current value, andoutputs a signal of “0” otherwise.

Chattering may occur in the output signal of the comparator 114 due toan influence of noise or the like. A current filter 111 is provided toexclude the chattering. That is, when the output signal of thecomparator 114 is switched, the current filter 111 waits for apredetermined filter time Tf and determines again whether the outputsignal of the comparator 114 is held in the switched value. When thedetermination result is positive, the current filter 111 outputs theswitched value of the output signal as a threshold excess flag CL.

The voltages VMout0 and VMout1 are also supplied to an A/D converter 117and a back electromotive force (BEMF) detector 118. The A/D converter117 measures and outputs a back electromotive force Vbemf of the statorwinding 124 based on the voltages VMout0 and VMout1. The backelectromotive force Vbemf is used to detect loss of synchronism. TheBEMF detector 118 outputs a flag ZC in response to switching of avoltage direction (zero cross) when the motor voltage VM is a backelectromotive force, that is, in a period in which a voltage is notapplied from the H-bridge circuit 20 to the stator winding 124.

The bridge controller 107 outputs a current control enable flag CLM. Thecurrent control enable flag CLM is set to “1” when changing of the PWMsignal supplied to the H-bridge circuit 20 is enabled, and is set to “0”when the changing is disabled. Specifically, the current control enableflag CLM is “1” between time Tcs and time Tce after the PWM cyclestarts. The current limit controller 112 controls the PWM signalgenerator 113 so as to hold the present PWM signal when the currentcontrol enable flag CLM is “0”.

FIGS. 3A to 3F are diagrams illustrating operation modes of the H-bridgecircuit 20.

FIG. 3A is a diagram illustrating a charge mode of the H-bridge circuit20.

When the absolute value of the motor current flowing in the statorwinding 124 increases, for example, the switching elements 4 and 6diagonally facing each other are switched to an ON state and the otherswitching elements 2 and 8 are switched to an OFF state. In this state,the motor current flows in the direction indicated by a broken line viathe switching element 6, the stator winding 124, and the switchingelement 4, and the motor current increases. This operation mode isreferred to as a “charge mode”. When the motor current is decreased at ahigh speed from this state, the charge mode transitions to a fast decaymode illustrated in FIG. 3B.

FIG. 3B is a diagram illustrating a fast decay mode of the H-bridgecircuit 20. When the absolute value of the motor current flowing in thestator winding 124 is decreased at a high speed, the switching elements4 and 6 diagonally facing each other are switched to the OFF state andthe other switching elements 2 and 8 are switched to the ON state to thecontrary to the previous charge mode. Since a back electromotive forceis generated in the stator winding 124, a current flows in the directionindicated by a broken line via the switching element 8, the statorwinding 124, and the switching element 2 and the motor current isdecreased at a high speed. This operation mode is referred to as a “fastdecay mode”.

When the current is decreased at a low speed from the charge modeillustrated in FIG. 3A or the fast decay mode illustrated in FIG. 3B,the operation mode transitions to a slow decay mode illustrated in FIG.3C.

FIG. 3C is a diagram illustrating a slow decay mode of the H-bridgecircuit 20. When the absolute value of the motor current flowing in thestator winding 124 is decreased at a speed lower than that in the fastdecay mode, the switching elements 2 and 6 on the voltage Vdd side areswitched to the ON state and the switching elements 4 and 8 on theground potential side are switched to the OFF state. Then, as indicatedby the broken line, a current looping around the switching elements 2and 6 and the stator winding 124 flows. This current is decreased by theimpedance of the switching elements 2 and 6 and the stator winding 124.The decay speed at this time is lower than that in the fast decay mode.This operation mode is referred to as a “slow decay mode”.

FIG. 3D is a diagram illustrating a variation of the slow decay mode ofthe H-bridge circuit 20.

When the absolute value of the motor current flowing in the statorwinding 124 is decreased at a speed lower than that in the fast decaymode, the switching elements 2 and 6 on the voltage Vdd side may beswitched to the OFF state and the switching elements 4 and 8 on theground potential side may be switched to the ON state. Then, asindicated by the broken line, a current looping around the switchingelements 4 and 8 and the stator winding 124 flows. This current isdecreased by the impedance of the switching elements 4 and 8 and thestator winding 124. The decay speed at this time is lower than that inthe fast decay mode.

Even when the gate voltage of a certain switching element is switched tothe OFF state, the switching element stays in the ON state for a whiledue to the parasitic capacitance of the gate of the switching element.Accordingly, for example, when the operation mode is instantaneouslyswitched from the charge mode (FIG. 3A) to the fast decay mode (FIG.3B), all the switching elements are instantaneously set to the ON state,and the voltage Vdd and the ground potential may be short-circuited tobreak down the switching elements. In order to prevent this situation,the H-bridge circuit 20 is set to an operation mode called a “shootthrough protection mode”.

FIG. 3E illustrates a shoot through protection mode in which all theswitching elements 2, 4, 6, and 8 are set to the OFF state.

When the operation mode is switched from the charge mode illustrated inFIG. 3A to the shoot through protection mode illustrated in FIG. 3E, aback electromotive force is generated in the stator winding 124 and thusthe motor current flows in the direction indicated by a broken line viathe diode 18, the stator winding 124, and the diode 12. In the shootthrough protection mode illustrated in FIG. 3E, since power loss occursdue to forward voltage drop of the diodes 12 and 18, the decay speed ofthe motor current is the highest.

When the charge mode illustrated in FIG. 3A and the slow decay modeillustrated in FIG. 3D are compared, the switching element 4 is in theON state in any mode. Accordingly, when the operation mode is switchedfrom the state illustrated in FIG. 3A to the state illustrated in FIG.3D, it does not cause any problem that the switching element 4 is heldin the ON state. Therefore, in this case, the shoot through protectionmode in which the switching element 4 is set to the ON state and theswitching elements 2, 6, and 8 are set to the OFF state can be employedas illustrated in FIG. 3F. In this case, the motor current loopingaround the switching element 4, the diode 18, and the stator winding 124flows as indicated by the broken line in the drawing.

In the state illustrated in FIG. 3F, since power loss due to the forwardvoltage drop of the diode 18 is generated, the decay speed is higherthan that in the slow decay mode, but the decay speed is much lower thanthat in the fast decay mode or the shoot through protection modeillustrated in FIG. 3E. When the operation mode is switched from thecharge mode or the fast decay mode to the slow decay mode, it means that“it is not intended to greatly decrease the motor current”, and thus theshoot through protection mode in which only one switching element is setto the ON state is selected as illustrated in FIG. 3F.

In FIG. 2, the operation mode which is designated to the bridgecontroller 107 from the CPU 101 is one of the charge mode, the slowdecay mode, and the fast decay mode, and the shoot through protectionmode is not explicitly designated in a control program to be describedlater. However, the bridge controller 107 does not immediately reflectthe designated operation mode but controls the PWM signal generator 113by necessarily inserting the shoot through protection mode (FIG. 3E or3F) therebetween.

In FIG. 2, the reference current value Iref supplied from the bridgecontroller 107 to the D/A converter 115 actually includes an X-phasereference current value IXref and a Y-phase reference current valueIYref. Setting examples of the reference current values IXref and IYrefin one turn of the stepping motor 120, that is, in a range in which therotation angle θ ranges from 0 to 2π, are illustrated in FIGS. 4A and4B. As illustrated in the drawings, the reference current values IXrefand IYref have waveforms obtained by approximating a cosine curve and asine curve using a stepwise wave. A system in which the referencecurrent values IXref and IYref are determined in this way to drive themotor 120 is referred to as a micro-step system, and has features ofsmall residual vibration and excellent stability particularly at thetime of low-speed rotation.

A cycle in which the stepwise wave varies is referred to as a micro-stepcycle Tm. It is preferable that the micro-step cycle Tm be equal to thePWM cycle or an integral multiple thereof. In the reference currentvalues IXref and IYref, a rising side and a falling side are alternatelyrepeated every π/2 of the rotation angle θ as illustrated in thedrawings. Here, the “rising side” is a side in which the absolute valuesof the reference current values IXref and IYref rise, and the “fallingside” is a side in which the absolute values fall.

FIG. 5 is a diagram illustrating current control data of each PWM cyclein the falling side to be controlled. The current control data isstored, for example, in the bridge controller 107. The bridge controller107 stores a charge mode time TON_o in a previous falling side and acharge mode time TON and a decay mode switching time Tfs in a presentfalling side, which are prepared based on the positions of the rotor andthe stator corresponding to the number of PWM cycles in the presentfalling side, in a memory in advance. The current control data includesa PWM cycle number indicating the order of a PWM cycle, the charge modetime TON_o in the previous rotation period, and the charge mode time TONand the decay mode switching time Tfs in the present rotation period.The PWM cycle number indicates the number of the PWM cycle synchronizedwith the rotation of the motor. The previous rotation period refers tothe previous falling side. Therefore, the charge mode time TON_oindicates the time of the charge mode in each PWM cycle in the previousfalling side.

The present rotation period refers to the present falling side.Accordingly, the charge mode time TON indicates the time of the chargemode in each PWM cycle in the present falling side. The decay modeswitching time Tfs refers to the timing at which the fast decay mode orthe charge mode is switched to the slow decay mode in the PWM cycle inthe falling side. The bridge controller 107 stores the current controldata of each PWM cycle in advance and dynamically rewrites the currentcontrol data with additional rotational driving.

FIG. 6 is a graph illustrating the falling side to be controlled. Thevertical axis of the graph represents the reference current value Iref.The horizontal axis of the graph represents the rotation angle θ. Whenthe rotation angle θ in the present falling side ranges from π to 3π/2,the rotation angle θ of the previous falling side ranges 0 to π/2 whichlags by a half turn. The rotation angle θ in a subsequent falling sideranges from 2π(to 5π/2 which advances by a half turn. That is, theprevious falling side lags by a half turn with respect to the presentfalling side. The subsequent falling side advances by a half turn withrespect to the present falling side.

The rotation angle θ and the PWM cycle of the motor 120 are synchronizedsuch that the same PWM cycle number has the same rotation angle θ in anyfalling side. Accordingly, the motor currents in the PWM cycles havingthe same number in different falling sides can be compared with eachother.

The previous falling side may be offset by one turn (2 n) from thepresent falling side and the subsequent falling side may be offset byone turn (2 n) with respect to the present falling side. At this time,the present falling side lags by one turn with respect to the previousfalling side. The subsequent falling side advances by one turn withrespect to the present falling side. Accordingly, even when the rotorhas asymmetry, a suitable control can be performed.

The previous falling side may be offset by an integral multiple (nπ) ofthe half turn from the present falling side and the subsequent fallingside may be offset by an integral multiple (nπ) of the half turn withrespect to the present falling side. For example, when periodicdisturbance is generated every two turns of the motor, it is possible tosuitably suppress the disturbance.

FIG. 7 is a diagram illustrating an example of the PWM cycle in thefalling side to be controlled. In FIG. 7, four PWM periods of Period 1to Period 4 are illustrated.

In the uppermost part in FIG. 7, a period in which the operation modesin the previous falling side is the charge mode is indicated by a blackline and indicates a section in which a charge mode flag Ton is 1. Inthe second uppermost part in FIG. 7, a period in which the operationmode in which the present falling side is the charge mode is indicatedby a black line.

The third uppermost part in FIG. 7 illustrates a waveform diagram of themeasured current value Icoil, and the reference current values Iref1 toIref3 are indicated by a two-dot chained line. The solid line indicatesthe measured current value Icoil in the present falling side and thebroken line indicates the measured current value Icoil in the previousfalling side.

Hereinafter, when the reference current values Iref1 to Iref3 are notparticularly distinguished, the reference current values are simplyreferred to as a reference current value Iref. As indicated by Period 2and Period 3, the reference current value Iref2 may be equal in pluralcontinuous PWM cycles.

The fourth and fifth uppermost parts in FIG. 7 illustrate waveformdiagrams of the voltages VMout0 and VMout1.

The sixth uppermost part in FIG. 7 illustrates a threshold excess flagCL which is an internal state of the bridge controller 107. The seventhuppermost part in FIG. 7 illustrates a current control enable flag CLMwhich is an internal output of the bridge controller 107. In thewaveform diagrams, the solid lines represent values in the presentfalling side and the broken lines represent values in the previousfalling side.

First, the operation in the previous falling side in Period 1 to Period2 will be described below.

The time Ts is a timing at which the present PWM cycle starts. When eachPWM cycle starts, the current control enable flag CLM begins with “0”which is set to the time Tce of the previous PWM cycle and the H-bridgecircuit 20 operates in the charge mode. At this time, the voltage VMout0has a level of the voltage Vdd and the voltage VMout1 has a groundlevel. The charge mode flag Ton is switched to “1”. The threshold excessflag CL is “0”.

In the time Tcs subsequent to the time Ts, the current control enableflag CLM is switched to “1”. Accordingly, the current limit controller112 controls the PWM signal generator 113 so as to enable changing ofthe PWM signal. The current control enable flag CLM is held in “1” up tothe time Tce to be described later.

When the measure current value Icoil is greater than the referencecurrent value Iref1 after the time Tcs and the filter time Tf elapsesadditionally, the threshold excess flag CL is switched to “1”. When thethreshold excess flag CL is switched to “1”, the charge mode ends andthe charge mode flag Ton is switched to “0”.

The charge mode time TON represents the time in which the charge mode isheld. The difference of the measured current value Icoil from thereference current value Iref1 can be measured using the charge mode timeTON. The charge mode time TON is a time in which the charge mode flagTon is set to “1”.

After the charge mode ends, the H-bridge circuit 20 is switched to thefast decay mode. At this time, the voltage VMout0 has the ground level.The voltage VMout1 has the level of the voltage Vdd. The thresholdexcess flag CL is “1”.

Thereafter, when the measured current value Icoil becomes less than thereference current value Iref1 and the filter time Tf elapsesadditionally, the threshold excess flag CL is switched to “0”.

In the decay mode switching time Tfs, the H-bridge circuit 20 isswitched to the slow decay mode. At this time, the voltages VMout0 andVMout1 have the ground level. The decay mode switching time Tfs employdifferent values depending on the PWM cycles. By appropriately settingthe decay mode switching time Tfs, it is possible to appropriatelydecrease the motor current in each PWM cycle and thus to approximate themotor current to the reference current value Iref. The decay modeswitching time Tfs is greater than the time Tcs and less than the timeTmax to be described later.

In the time Tce, the current control enable flag CLM is switched to “0”.Accordingly, the current limit controller 112 does not enable changingof the PWM signal but always controls the PWM signal generator 113 inthe slow decay mode. In Period 1, since the H-bridge circuit 20 isalready in the slow decay mode, the operation mode is not switched.

The time Te is a timing at which the PWM cycle of Period 1 ends and isthe same timing as the time Ts at which the PWM cycle of Period 2starts. Thereafter, the same PWM cycle as in Period 1 is performed.

The difference from the operation in the previous falling side indicatedby the broken line in Period 1 and Period 2 will be described below. Inthe previous falling side, the H-bridge circuit 20 is switched from thefast decay mode to the slow decay mode earlier than the present fallingside. At the timing at which the PWM cycle of Period 2 starts, themeasured current value Icoil has a value less than that in the previousfalling side and is brought close to the reference current value Iref2.The charge mode time in the previous falling side of Period 2 is shorterthan the charge mode time in the present falling side.

The operation in the previous falling side of Period 3 and Period 4 willbe described below.

As can be seen from the measured current value Icoil in the previousfalling side indicated by the broken line in Period 3, the H-bridgecircuit 20 is first switched to the slow decay mode in the time Tmax.That is, the time Tmax is the same as the decay mode switching time Tfs.

As can be seen from the measured current value Icoil in the presentfalling side indicated by the solid line, the H-bridge circuit 20 isswitched to the slow decay mode in the decay mode switching time Tfsearlier than that in the previous falling side. Accordingly, themeasured current value Icoil gets closer to the reference current valueIref3 than that in the previous falling side.

This is because the measured current value Icoil prior by one step(prior by one PWM cycle, that is, Period 3) in the present falling sideis decreased less and thus the charge mode starts from a greater currentvalue in Period 4. On the contrary, when the charge mode time TON isshort, it means that the measured current value Icoil prior by one stepis decreased less. That is, it is possible to determine decay of thecoil current based on the charge mode time TON.

As illustrated in Period 3 and Period 4, when the decay mode switchingtime Tfs is long, the period of the fast decay mode is elongated and themeasured current value Icoil is decreased more. On the contrary, whenthe decay mode switching time Tfs is short, the period of the fast decaymode is shortened and the measured current value Icoil is decreasedless.

Therefore, by d the decay mode switching time Tfs prior by one step(prior by one PWM cycle) so as to remove an increase in the charge modetime TON, it is possible to suitably bring the measured current valueIcoil close to the reference current value Iref. A process flow forrealizing this will be described below with reference to FIGS. 8 to 10.

FIGS. 8 and 9 are flowcharts illustrating a falling side controlroutine.

FIGS. 8 and 9 illustrate a control program which is stored in the ROM103 and is executed by the CPU 101 and which is started every PWM cyclein the falling side.

The falling side control routine is started in step S1 of FIG. 8. Instep S1, the timer 104 is reset and then the elapsed time after the PWMcycle starts is counted. In step S1, the reference current value Iref(the reference current value IXref or the reference current value IYrefin FIGS. 4A and 4B) in the corresponding PWM cycle is determined basedon the estimated value of the rotation angle θ of the rotor 126 and thewaveform illustrated in FIG. 4A or 4B, and the determined referencecurrent value Iref is set in the bridge controller 107 (see FIG. 2).

The current control enable flag CLM is set to “0” in the previous PWMcycle. The current control enable flag CLM set in the previous PWM cycleis continuously used in the present PWM cycle. In the previous PWMcycle, the current control enable flag CLM is set to “0” by performingthe process of step S33 to be described later. Details of the process ofstep S33 will be described later.

In step S10, the PWM signal generator 113 causes the H-bridge circuit 20to operate in the charge mode. In step S11, the bridge controller 107starts measuring the charge mode time TON.

Then, in step S12, the bridge controller 107 acquires the elapsed timefrom the timer 104 and the current limit controller 112 acquires thethreshold excess flag CL. The elapsed time and the threshold excess flagCL in this routine are not changed until step S12 is performed again.

Steps S13 to S15 are processes of enabling the current control in thetime Tcs in FIG. 7. In step S13, the bridge controller 107 determineswhether the time Tcs elapses, and moves the routine to step S34 of FIG.9 when the determination conditions is not satisfied. Through theprocess of step S10, the H-bridge circuit 20 operates in the charge modewhen the PWM cycle starts. Through the process of step S13, the periodfrom the time Ts at which the PWM cycle starts to the time Tcs is aminimum ON time.

When the minimum ON time is not provided, the current waveform may fallgreatly. That is, since the ripples of the current waveform increase,the torque loss, the vibration, and the noise of the motor increase. Onthe contrary, in the embodiment, since the operation mode is set to thecharge mode from the time at which the PWM cycle starts to the time Tcs,it is possible to suppress the current ripples of the motor current.Accordingly, it is possible to enhance the driving efficiency of themotor and to reduce the torque loss, the noise, the vibration, and thelike of the motor.

The bridge controller 107 determines whether the time Tcs comes in stepS14, and sets the current control enable flag CLM to “1” in step S15when the determination condition is satisfied (YES). The current controlenable flag CLM is referred to in step S18 to be described later.

Steps S16 to S21 are processes of switching the charge mode to the fastdecay mode after the time Tcs and before the decay mode switching timeTfs in FIG. 7.

The bridge controller 107 determines whether the time Tcs elapses instep S16, and moves the routine to step S22 in FIG. 9 when thedetermination condition is satisfied (YES).

The current limit controller 112 determines whether the threshold excessflag CL is “1” in step S17, and moves the routine to step S22 in FIG. 9when the determination condition is not satisfied (NO).

The current limit controller 112 determines whether the current controlenable flag CLM is “1” in step S18, and moves the routine to step S22 inFIG. 9 when the determination condition is not satisfied (NO).

Then, the bridge controller 107 determines whether the H-bridge circuit20 operates in the charge mode in step S19, and moves the routine tostep S22 in FIG. 9 when the determination condition is not satisfied(NO).

The bridge controller 107 stores the charge mode time TON in step S20,the PWM signal generator 113 instructs the H-bridge circuit 20 tooperate in the fast decay mode in step S21, and the routine moves tostep S22 in FIG. 9.

Steps S22 to S26 in FIG. 9 are processes of switching the operation modefrom the charge mode or the fast decay mode to the slow decay mode inthe decay mode switching time Tfs after the time Tcs in FIG. 7.

The bridge controller 107 determines whether the decay mode switchingtime Tfs elapses in step S22, and moves the routine to step S34 when thedetermination condition is not satisfied (NO).

The bridge controller 107 determines whether the decay mode switchingtime Tfs comes in step S23, and moves the routine to step S27 when thedetermination condition is not satisfied (NO).

The bridge controller 107 determines whether the H-bridge circuit 20operates in the charge mode in step S24, and stores the charge mode timeTON in step S25 when the determination condition is satisfied (YES).

In step S26, the PWM signal generator 113 instructs the H-bridge circuit20 to operate in the slow decay mode. Through this process, in the decaymode switching time Tfs in Periods 1 to 4 in FIG. 7, the measuredcurrent value Icoil indicated by the solid line is switched from steepdecay to slow decay. The decay mode switching time Tfs in the previousfalling side is not illustrated in FIG. 7, but for example, in Periods 2and 4, the measured current value Icoil indicated by the broken line isswitched from the steep decay to the slow decay. The switching time isthe decay mode switching time Tfs in the previous falling side.

Steps S27 to S30 are processes of switching the operation mode from thecharge mode or the fast decay mode to the slow decay mode in the timeTmax after the time Tcs and the decay mode switching time Tfs in FIG. 7.

The bridge controller 107 determines whether the time Tmax comes in stepS27, and moves the routine to step S31 when the determination conditionis not satisfied (NO).

Then, the bridge controller 107 determines whether the H-bridge circuit20 operates in the charge mode in step S28, and stores the charge modetime TON in step S29 when the determination condition is satisfied(YES).

In step S30, the PWM signal generator 113 instructs the H-bridge circuit20 to operate in the slow decay mode. Through this process, in the timeTmax in Period 3 illustrated in FIG. 7, the measured current value Icoilindicated by the broken line is switched from steep decay to slow decay.

Steps S31 to S33 are processes of preparing for a subsequent PWM cyclein the time Tce after the time Tcs and the decay mode switching time Tfsin FIG. 7.

The bridge controller 107 determines whether the time Tce comes in stepS31, and moves the routine to step S34 when the determination conditionis not satisfied (NO). When the determination condition is satisfied(YES), the bridge controller 107 sets the motor operation condition andthe decay mode switching time (see FIG. 10) of the subsequent PWM cyclein step S32, and sets the current control enable flag CLM to “0” in stepS33. The current control enable flag CLM set in step S33 is continuouslyused in the subsequent PWM cycle.

The bridge controller 107 determines whether the time Te at which thepresent PWM cycle ends comes in step S34, returns the routine to stepS12 in FIG. 8 and repeats the process on the present PWM cycle when thedetermination condition is not satisfied (NO). When the determinationcondition is satisfied (YES), the bridge controller 107 ends theprocesses on the present PWM cycle.

FIG. 10 is a flowchart illustrating a decay mode switching time settingprocess. Details of the decay mode switching time setting process whichis performed at the same time as performing the motor operationcondition setting process of step S32 in FIG. 9.

In step S40, the bridge controller 107 acquires the charge mode time TONof the present PWM cycle.

In step S41, the bridge controller 107 determines whether the chargemode time TON is greater than the charge mode time TON_o of the PWMcycle having the same number as in the previous falling side. The bridgecontroller 107 moves the routine to step S42 when it is determined thatthe charge mode time TON is greater than the previous charge mode timeTON_o (YES), and moves the routine to step S43 when it is determinedthat the charge mode time TON is not greater than the previous chargemode time TON_o.

The bridge controller 107 decreases the decay mode switching time Tfsprior by one step in the subsequent falling side by a predeterminedamount in step S42, and moves the routine to step S44. The decay modeswitching time Tfs prior by one step means that the PWM cycle number isless by one.

In step S43, the bridge controller 107 increases the decay modeswitching time Tfs prior by one step in the subsequent falling side by apredetermined amount.

In step S44, the bridge controller 107 sets the charge mode time TON asthe charge mode time TON_o. Accordingly, the present charge mode timeTON is referred to as the charge mode time TON_o in the subsequentfalling side. When the process of step S44 is completed, the bridgecontroller 107 ends the routine illustrated in FIG. 10.

In the decay mode switching time setting process, the decay modeswitching time Tfs prior by one step in the subsequent falling side ischanged so as to stabilize the charge mode time TON in the subsequentfalling side in comparison with the present falling side. Accordingly,in the subsequent falling side, the measured current value Icoil can bebrought close to the reference current value Iref.

FIG. 11 is a diagram illustrating an example in which the motor rotationangle θ is synchronized with the PWM cycle every π/2.

The vertical axis of FIG. 11 represents the reference current valueIref. The horizontal axis of FIG. 11 represents the rotation angle θ.Circles in the X axis indicate synchronization of the motor rotationangle θ and the PWM cycle by the motor controller 100.

The motor controller 100 according to the embodiment synchronizes themotor rotation angle θ with the PWM cycle every π/2, that is, 90degrees. That is, the start point of the PWM cycle is reset every π/2 ofthe motor rotation angle θ. Accordingly, it is possible to freely setthe PWM cycle. The reset timing of the PWM cycle is not particularlylimited as long as the timing is based on the π/2 cycle of the motorrotation angle θ.

When the motor rotation angle θ is not synchronized with the PWM cycle,a control delay corresponding to one PWM cycle to the maximum occurs.This delay has an influence until the motor rotation angle θ issynchronized with the PWM cycle again. A case in which differentreference current values Iref are set even in the PWM cycles having thesame number depending on the motor rotation angle θ occurs due to thisdelay and thus the charge mode times TON may not be correctly compared.

FIG. 12 is a diagram illustrating a modified example in which the motorrotation angle θ is synchronized with the PWM cycle every π.

The vertical axis of FIG. 12 represents the reference current valueIref. The horizontal axis of FIG. 12 represents the rotation angle θ.Circles in the X axis indicate synchronization of the motor rotationangle θ and the PWM cycle by the motor controller 100.

The motor controller 100 according to the modified example synchronizesthe motor rotation angle θ with the PWM cycle every π. That is, themotor rotation angle θ is synchronized with the PWM cycle every 180degrees. The reset timing of the PWM cycle is not particularly limitedas long as the timing is based on the π cycle of the motor rotationangle θ.

FIG. 13 is a diagram illustrating a modified example in which the motorrotation angle θ is synchronized with the PWM cycle every 2π.

The vertical axis of FIG. 13 represents the reference current valueIref. The horizontal axis of FIG. 13 represents the rotation angle θ.Circles in the X axis indicate synchronization of the motor rotationangle θ and the PWM cycle by the motor controller 100.

The motor controller 100 according to the modified example synchronizesthe motor rotation angle θ with the PWM cycle every 2π, that is, every360 degrees. The reset timing of the PWM cycle is not particularlylimited as long as the timing is based on the 2π cycle of the motorrotation angle θ. Accordingly, it is possible to reduce a load of theprocess of synchronizing the motor rotation angle θ with the PWM cycle.

The present invention is limited to the above-mentioned embodiments, butcan be modified in various forms. The above-mentioned embodiments areonly examples for facilitating understanding of the present invention,and the present invention is not limited to the configurations havingall the above-mentioned elements. A part of elements of a certainembodiment A can be replaced with the elements of the other embodiment,and the elements of the other embodiment may be added to theconfiguration of the embodiment A. Some elements of each embodiment maybe deleted or may be additionally replaced with other elements. Examplesof modifications of the above-mentioned embodiments include thefollowing modes.

(1) The routines are described above as software routines using aprogram in the above-mentioned embodiments, but may be realized ashardware routines using an application specific integrated circuit (IC)(ASIC), a field-programmable gate array (FPGA), or the like.

(2) The FETs are applied as the switching elements constituting theH-bridge circuit 20 in the above-mentioned embodiments, bipolartransistors, insulated gate bipolar transistors (IGBTs), and otherswitching elements may be applied instead of the FETs.

(3) A bipolar two-phase stepping motor is applied as the motor 120 inthe above-mentioned embodiments, but the type or the number of phases ofthe motor 120 can vary depending on the application thereof.

(4) The above-mentioned embodiments employ a micro-step system as asystem of setting the reference current value Iref, but a valuecontinuously varying with respect to the rotation angle θ may be used asthe reference current value Iref.

According to the present invention, it is possible to provide a motorcurrent controller and a method for controlling motor current that cansuitably control a motor current to follow a target value with alow-cost configuration.

What is claimed is:
 1. A motor current controller comprising: anH-bridge circuit that includes a switching element and is connected to amotor coil provided in a motor; and a control unit that drives theswitching element every PWM cycle and designates any operation mode fromamong a plurality of modes including a charge mode, in which a motorcurrent flowing in the motor coil increases, a fast decay mode, in whichthe motor current is decreased, and a slow decay mode, in which themotor current is decreased at a speed lower than that in the fast decaymode, for the H-bridge circuit, wherein the control unit is configuredto perform a series of process comprising: setting a reference currentvalue and a decay mode switching time for each PWM cycle based on apositional relationship between a rotor and a stator; switching theH-bridge circuit to the charge mode at the time of start of each PWMcycle; determining whether the motor current is greater than thereference current value; switching the H-bridge circuit to the fastdecay mode and storing a charge mode time when determined that the motorcurrent is greater than the reference current value; switching theH-bridge circuit to the slow decay mode when the decay mode switchingtime elapses after a time point at which the H-bridge circuit isswitched to the fast decay mode; comparing the charge mode time of thecorresponding PWM cycle in a present falling side with the charge modetime of the PWM cycle having the same number as the corresponding PWMcycle in a previous falling side; and updating, based on a result of thecomparing of the charge modes, the decay mode switching time of the PWMcycle previous to the corresponding PWM cycle in a subsequent fallingside.
 2. The motor current controller according to claim 1, wherein thecontrol unit is configured to perform the series of process furthercomprising: decreasing the decay mode switching time of the PWM cycleprevious to the corresponding to the PMW cycle in the subsequent fallingside when the charge mode time of the corresponding PWM cycle in thepresent falling side is longer than the charge mode time of the PWMcycle having the same number as the corresponding PWM cycle in theprevious falling side; and increasing the decay mode switching time ofthe PWM cycle previous to the corresponding to the PMW cycle in thesubsequent falling side when the charge mode time of the correspondingPWM cycle in the present falling side is shorter than the charge modetime of the PWM cycle having the same number as the corresponding PWMcycle in the previous falling side.
 3. The motor current controlleraccording to claim 1, wherein the control unit is configured to performthe series of process further comprising: synchronizing the PWM cyclewith every predetermined phase angle of the motor.
 4. The motor currentcontroller according to claim 3, wherein the predetermined phase angleis one of angles including π/2, π, and 2π.
 5. A method for controllingmotor current of a motor current controller having an H-bridge circuitthat includes a switching element and is connected to a motor coilprovided in a motor and a control unit that drives the switching elementevery PWM cycle and designates any operation mode from among a pluralityof modes including a charge mode, in which a motor current flowing inthe motor coil increases, a fast decay mode, in which the motor currentis decreased, and a slow decay mode, in which the motor current isdecreased at a speed lower than that in the fast decay mode, for theH-bridge circuit, the method comprising: setting a reference currentvalue and a decay mode switching time for each PWM cycle based on apositional relationship between a rotor and a stator; switching theH-bridge circuit to the charge mode at the time of start of each PWMcycle; determining whether the motor current is greater than thereference current value; switching the H-bridge circuit to the fastdecay mode and storing a charge mode time when determined that the motorcurrent is greater than the reference current value; switching theH-bridge circuit to the slow decay mode when the decay mode switchingtime elapses after a time point at which the H-bridge circuit isswitched to the fast decay mode; comparing the charge mode time of thecorresponding PWM cycle in a present falling side with the charge modetime of the PWM cycle having the same number as the corresponding PWMcycle in a previous falling side; and updating, based on a result of thecomparing of the charge modes, the decay mode switching time of the PWMcycle previous to the corresponding PWM cycle in a subsequent fallingside.